package org.test.util;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;

public class MyCollectionUtil {

	/**
	 * 把"a1,b2,c3" 转为list
	 * 
	 * @param msgString
	 *            形如 "a1,b2,c3"
	 * @param regex
	 *            形如","
	 * @return Map
	 * @author：denggm@asiainfo-linkage.com
	 * @Nov 5, 2012 10:14:49 AM
	 */
	public static List<String> converStringToList(String msgString, String regex) {
		if (msgString == null) {
			return new ArrayList<String>();
		}
		String[] stringArray = msgString.split(regex);
		List<String> idataset = new ArrayList<String>();
		CollectionUtils.addAll(idataset, stringArray);
		return idataset;
	}
}
